package com.metaera.app.controller.presenter;

import com.metaera.app.controller.core.RequestPresenter;
import com.metaera.app.controller.view.core.INetworkRequestView;
import com.metaera.app.data.DataRepository;
import com.metaera.app.data.model.HotSearchResponse;
import com.metaera.app.data.rx.ResponseObserver;
import com.metaera.app.data.rx.SchedulersTransformer;

import java.util.List;

/**
 * 热搜
 */
public class SearchHotPresenter extends RequestPresenter<INetworkRequestView<List<HotSearchResponse>>> {

    public void hotSearch(){
        DataRepository.getInstance()
                .hotSearch()
                .compose(SchedulersTransformer.transformer())
                .subscribe(new ResponseObserver<>(
                                this,
                                mView,
                                response -> mView.successful(response.getData())
                        )
                );
    }

}
